GBML manual / Text

text_align

Sets how every draw_text call aligns its (x, y) against the text from here on - one of ALIGN_LEFT/ALIGN_CENTER/ALIGN_RIGHT.

Syntax

text_align(align)

Arguments

NameType
alignalignment

Returns

Nothing.

Description

Sets how every draw_text call aligns its (x, y) against the text from here on, until changed again - ambient state, the same shape font_set uses. One of ALIGN_LEFT, ALIGN_CENTER or ALIGN_RIGHT.

A text of several lines (a \n in the string) is aligned line by line: every line is centered on x, or ends at it.

Example

text_align(ALIGN_CENTER);

Centers every following text call on its own (x, y), the usual choice for a title or a centered HUD readout - ALIGN_LEFT (the default) is more usual for a left-fixed HUD line, ALIGN_RIGHT for one anchored to the right edge.

A real capture - the word CENTER, centered on the point it was drawn at rather than starting thereA real capture - the word CENTER, centered on the point it was drawn at rather than starting there
A real capture - the word CENTER, centered on the point it was drawn at rather than starting there
See also: draw_textfont_set